package com.theaf.basemodule.common.vo.user;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;


@ApiModel(description = "用户VO数据")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserVO implements Serializable{
    private Long id;

    @NotNull(message = "用户名不能空")
    @ApiModelProperty(value = "用户名" , required = true)
    private String userName;

    @NotNull(message = "用户密码不能为空")
    @Length(min=6, max=16 , message = "密码长度范围为{min}-{max}位")
    @ApiModelProperty(value = "密码" , required = true)
    private String password;

    @NotNull(message = "机构ID不能空")
    @ApiModelProperty(value = "机构ID", required = true)
    private Long orgId;

    @NotNull(message = "姓名不能为空")
    @Length(min=2, max=16 , message = "姓名长度范围为{min}-{max}位")
    @ApiModelProperty(value = "姓名", required = true)
    private String cname;

    @NotNull(message = "手机不能为空")
    @Pattern(regexp="(0)?1[0-9]{10}" , message = "手机格式不正确")
    @ApiModelProperty(value = "手机", required = true)
    private String mobile;

    @ApiModelProperty(value = "邮箱")
    @Email
    private String mail;

    @ApiModelProperty(value = "是否启用")
    private Boolean enable=true;

    @ApiModelProperty(value = "企业微信")
    @Length(min=0, max=32 , message = "企业微信范围为{min}-{max}位")
    private String wxId;

    @ApiModelProperty(value = "是否重复登录")
    private boolean repeated;

    @ApiModelProperty(value = "岗位")
    @NotNull(message = "岗位不能为空")
    private Long posId;

    @ApiModelProperty(value = "限制IP")
    @Length(min=0, max=100 , message = "限制IP范围为{min}-{max}位")
    private String limitIp;

    @ApiModelProperty(value = "增加调整的功能权限")
    private List<Long> adjustAdd = new ArrayList();

    @ApiModelProperty(value = "删除调整的功能权限")
    private List<Long> adjustRemove = new ArrayList();

    @ApiModelProperty(value = "机构数据范围")
    private List<OrgRangeVO> orgRanges = new ArrayList();

    @ApiModelProperty(value = "自定义机构数据范围，多选，见数据字典")
    private List<String> cusRanges;

    @ApiModelProperty(value = "业务板块（多选,存储为字典编码）")
    private  List<String> busPlates = new ArrayList();

}
